<?
if(!defined ('U_MOD'))
{
	echo"<meta http-equiv='refresh' content='0;url=/index.php'>";
	exit;
}

$refferUrl=getRefferUrl($_SERVER['HTTP_REFERER'], $portal_url);

if (isset($act) && is_numeric($act))
{
	if ($act==1 && isset($rid))
	{
		$querySelectRightTitle=mysql_query("SELECT right_title, right_value FROM ".$PortalPref."right WHERE right_id='".$rid."'");
		if (mysql_num_rows($querySelectRightTitle)==1)
		{
			$resultSelectRightTitle=mysql_fetch_assoc($querySelectRightTitle);
			extract($resultSelectRightTitle);

			if ($right_value==0 || $right_value==100000 || $right_value==70000)
				print '<p align="center">'._CANNOT_DEL_SYS_RIGHT_.'</p>';			else
			{				if(mysql_query("DELETE FROM ".$PortalPref."right WHERE right_id='".$rid."'"))
				{
					$avialable_langs = explode(",", $option['avialable_langs']);

					for($lid=0; $lid<count($avialable_langs); $lid++)
					{
						mysql_query("DELETE FROM ".$PortalPref."langs_".$avialable_langs[$lid]." WHERE lang_param='".$right_title."'");
					}

					print '<p align="center">'._OPERATION_SUCCESS_.'</p>';
				}else
					print '<p align="center">'.BAD_SQL_.'</p>';			}

		}else
			print '<p align="center">'.BAD_SQL_.'</p>';
	}
}

echo"<meta http-equiv='refresh' content='0;url=".$refferUrl."'>";
?>